const a = ["Hydrogen", "Helium", "Lithium", "Beryllium"];
const a2 = a.map(
    (x) => x.length
)
console.log(a2);

console.log('----------------');

function 人() {
    this.age = 0;
    this.定时器 = null;
    this.开始 = function () {
        if (this.定时器 !== null) {
            return;
        }
        this.定时器 = setInterval(() => {
            this.age++;

        }, 1000);
    };
    this.结束 = function () {
        if (this.定时器 === null) {
            return;
        }
        clearInterval(this.定时器);
        this.定时器 = null;
    }
}
const p = new 人();
p.开始();
console.log(p);
await new Promise((回调) => setTimeout(回调, 3000));
console.log(p);
p.结束();
